import React from "react"
import { Button } from "@tarojs/components"
import clsx from "clsx"
import GpIcon from "@/components/GpFontIcon"

type IProps = {
  className?: string
  shareText?: React.ReactNode
  icon?: string
  /** @default 28 */
  iconSize?: number
  iconClassName?: string
}
/** minimal share button */
const GpShareButton: React.FC<IProps> = (props: IProps) => {
  const {
    className,
    shareText = "转发",
    icon = "icon-a-fenxiang_huaban1",
    iconSize = 28,
    iconClassName
  } = props
  return (
    <Button openType="share" className={clsx("yahei ", "GpShareButton__shareBtn", className)}>
      <GpIcon icon={icon} size={iconSize} className={clsx("pl-8px align-middle", iconClassName)} />
      {shareText}
    </Button>
  )
}
export default GpShareButton
